<template>
	<view>
		<!-- 导航 -->
		<u-navbar back-text="搜索" :back-text-style="textStyle" back-icon-color="#000000"
			style="font-weight: bold;font-family: PingFang SC;"></u-navbar>
		<!-- <view style="position: fixed; width: 100%;top: 140rpx;left: 0rpx;background-color: white;z-index: 100rpx;"> -->
		<!-- 		<view @tap.stop="serach()" style="width: 93%;margin: auto;height: 66rpx;border: 1rpx solid #FB6112;border-radius: 33rpx;position: relative;">
				<view style="width: 100%;display: flex;align-items: center;">
					<image style="width: 26rpx;height: 32rpx;margin: 0rpx 10rpx 0rpx 15rpx;" src="../../../static/gx_img/dw_icon.png"></image>
					<view @tap.stop="jumpToSelectCity" style="width: 120rpx;font-size: 26rpx;line-height: 66rpx; color: #000000;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;">
					{{siteName||'郑州市'}}	
					</view>
					<view style="height:34rpx ;width: 1rpx;background-color:#D2D2D2 ;margin-right: 18rpx;"></view>
					<u-icon name="search" color="#D2D2D2" size="28"></u-icon>
					<view style="font-size: 26rpx;color: #E4E4E4;margin-left: 10rpx;">{{texts}}</view>
				</view>
				<view  style="top: 2rpx;right: 2rpx;color: white; position: absolute; border-radius: 32rpx; text-align: center;line-height: 58rpx; width:106rpx;height: 58rpx;background: linear-gradient(180deg, #FB5A0B 0%, #FFAA00 100%);font-size: 26rpx;"
				>
					搜索
				</view>
			</view> -->
		<view
			style="width: 93%;margin: auto;height: 66rpx;border: 1rpx solid #FB6112;border-radius: 33rpx;position: relative;">
			<view style="width: 100%;display: flex;align-items: center;">
				<image style="width: 26rpx;height: 32rpx;margin: 0rpx 10rpx 0rpx 15rpx;"
					src="../../../static/gx_img/dw_icon.png"></image>
				<view @tap.stop="jumpToSelectCity"
					style="width: 120rpx;font-size: 26rpx;line-height: 66rpx; color: #000000;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;">
					{{siteName||'郑州市'}}
				</view>
				<view style="height:34rpx ;width: 1rpx;background-color:#D2D2D2 ;margin-right: 18rpx;"></view>
				<u-icon name="search" color="#D2D2D2" size="28"></u-icon>
				<view style="width: 350rpx; font-size: 26rpx;color: #333333;margin-left: 10rpx;">
					<input type="text" :adjust-position="true" v-model="texts" placeholder-class="placeholder-class"
						confirm-type="search" placeholder-style="font-size: 26rpx;color: #E4E4E4;" />
				</view>
			</view>
			<view @tap="doSearch(keyword)"
				style="top: 2rpx;right: 2rpx;color: white; position: absolute; border-radius: 32rpx; text-align: center;line-height: 58rpx; width:106rpx;height: 58rpx;background: linear-gradient(180deg, #FB5A0B 0%, #FFAA00 100%);font-size: 26rpx;">
				搜索
			</view>
		</view>
		<view class="up" style="">
			<!-- <view class="heng"></view> -->
			<u-tabs :list="list" active-color="#F93910" inactive-color="#000000" height="85" font-size="34rpx"
				bar-width="110" :is-scroll="false" :current="current" @change="change"></u-tabs>
		</view>
		<!-- 	</view> -->
		<mescroll-body top="20" :down="downOption" :height="comHeight" :up="upOption" ref="mescrollRef"
			@init="mescrollInit" @down="downCallback">
			<view style="width: 93%;margin: auto;">
				<view v-if="current == 0">
					<!-- 家政人员 -->
					<view v-if="!isShow">
						<view class="oderList" style="margin-bottom:24rpx ;" v-for="(item,index) in serviceList"
							:data-id="item.employeeId" :key="index">
							<view
								style="width:100% ;margin: auto;display: flex;align-items: center;justify-content: space-between;">

								<image style="width:130rpx;height: 130rpx;" :src="item.icon" mode="aspectFill"></image>
								<view style="width: 60%;margin: 0rpx 10rpx;min-height: 130rpx;">
									<view style="color:#656565 ;font-size: 30rpx;">{{item.name}}</view>
									<view style="width: 100%;display: flex;margin-top: 10rpx;flex-wrap: wrap;">
										<text
											style="color: #929292;font-size:20rpx ;padding: 8rpx; background-color: #F3F4F8;margin-bottom: 10rpx; margin-right: 15rpx;">平台担保</text>
										<text
											style="color: #929292;font-size:20rpx ;padding: 8rpx; background-color: #F3F4F8;margin-bottom: 10rpx; margin-right: 15rpx;">快速安全</text>
										<text
											style="color: #929292;font-size:20rpx ;padding: 8rpx; background-color: #F3F4F8;margin-bottom: 10rpx; margin-right: 15rpx;">一键下单</text>
										<text
											style="color: #929292;font-size:20rpx ;padding: 8rpx; background-color: #F3F4F8;margin-bottom: 10rpx; margin-right: 15rpx;">随时预约</text>



									</view>
								</view>
								<view>
									<text @tap="serviceList_jump(item)"
										style="color:#F93D0F ;font-size: 26rpx;text-align: center;line-height: 50rpx;  display: inline-block;width: 128rpx;height: 50rpx;background: #FFFFFF;border: 1px solid #F83A0F;opacity: 1;border-radius:16rpx;">
										立即下单
									</text>
								</view>
							</view>

						</view>
						<view style="display: flex;align-items: center;padding:10rpx ;">
							<view style="line-height: 44rpx; font-size: 32rpx;color: #000000;">为您推荐</view>
							<view style="height: 30rpx;margin-left: 10rpx;">
								<image style="width: 70rpx;height: 30rpx;" src="../../../static/gx_img/tuijian.png">
								</image>
							</view>
						</view>
						<view class="oderList" style="margin-bottom:24rpx ;" v-for="(item,index) in servetuijian"
							:key="index">
							<view
								style="width:100% ;margin: auto;display: flex;align-items: center;justify-content: space-between;">

								<image style="width:130rpx;height: 130rpx;" :src="item.icon"></image>
								<view style="width: 60%;margin: 0rpx 10rpx;min-height: 130rpx;">
									<view style="color:#656565 ;font-size: 30rpx;">{{item.name}}</view>
									<view style="width: 100%;display: flex;margin-top: 10rpx;flex-wrap: wrap;">
										<text
											style="color: #929292;font-size:20rpx ;padding: 8rpx; background-color: #F3F4F8;margin-bottom: 10rpx; margin-right: 15rpx;">平台担保</text>
										<text
											style="color: #929292;font-size:20rpx ;padding: 8rpx; background-color: #F3F4F8;margin-bottom: 10rpx; margin-right: 15rpx;">快速安全</text>
										<text
											style="color: #929292;font-size:20rpx ;padding: 8rpx; background-color: #F3F4F8;margin-bottom: 10rpx; margin-right: 15rpx;">一键下单</text>
										<text
											style="color: #929292;font-size:20rpx ;padding: 8rpx; background-color: #F3F4F8;margin-bottom: 10rpx; margin-right: 15rpx;">随时预约</text>


									</view>
								</view>
								<view>
									<text @tap="gojump(item) "
										style="color:#F93D0F ;font-size: 26rpx;text-align: center;line-height: 50rpx;  display: inline-block;width: 128rpx;height: 50rpx;background: #FFFFFF;border: 1px solid #F83A0F;opacity: 1;border-radius:16rpx;">
										立即下单
									</text>
								</view>
							</view>

						</view>


						<view style="margin-top: 50rpx;">
							<u-divider color="#DEDEDE" half-width="120" border-color="#DEDEDE">{{ prompt }}</u-divider>
						</view>
					</view>

					<view v-if="isShow" style="margin-top: 100rpx;text-align: center;">
						<image src="../../../static/img/1-35.png" style="width: 450rpx;height: 450rpx;"></image>
						<view class="typeface1">暂无数据</view>
					</view>


				</view>


				<!--商家列表  -->
				<view v-if="current == 1">
					<view class="unit" v-for="(ites, indes) in shops" :key="indes" @click="shopDetail(ites)">

						<view style="width: 100%;margin: auto;display: flex;">
							<view style="width:23% ;">
								<image class="" style="width: 146rpx;height: 132rpx;" :src="ites.portrait"
									mode="aspectFill"></image>
							</view>
							<view style="width:77%;">
								<view style="color: #3F3F3F;font-size: 30rpx;font-weight: 800;">{{ ites.name }}</view>
								<view style="display: flex;align-items: center;margin: 10rpx 0rpx;">
									<view style="color: #F29423;font-size: 26rpx;text-align: left;">{{ ites.score }}分
									</view>
									<image style="width:28rpx ;height: 26rpx;margin: 0rpx 10rpx 0rpx 20rpx;"
										src="../../../static/gx_img/sjlist_2.png"></image>
									<view style="color: #000000;font-size: 26rpx;">已服务{{ ites.serverNum||'0' }}次</view>
								</view>
								<view style="overflow: hidden; width: 100%;justify-content: space-between;">
									<!-- <view style="float: left; display: flex;font-size: 20rpx;width: 264rpx;border-radius: 10rpx;border: 1rpx solid #FF4B34;">
											<view style="text-align: center; width: 180rpx;height: 40rpx;background: #FF4B34;color: white;font-size: 20rpx;line-height: 40rpx;">百亿补贴家电清洗季</view>
											<view style="width: 84rpx;height: 40rpx;color:#FF3D00 ;text-align: center;line-height: 40rpx;">
												领券
											</view>
										</view> -->
									<view style="float: right; color:#989898;font-size: 26rpx;">{{ites.region}}</view>
								</view>
							</view>
						</view>
						<view v-for="(itt, ind) in ites.packageBisPageVOS" :key="ind">
							<view class="unit2">
								<view class="sales" :class="ind>0?'sa_bottoms':''" style="">

									<view style="display: flex;width: 100%;">
										<image src="../../../static/icon/nears.png" mode=""
											style="width: 26rpx;height: 26rpx;margin-top: 10rpx;"></image>
										<view style="width: 100%;margin: auto;">
											<view class="hour" style="padding-left: 32rpx;">
												<view style="color: #F29423;font-size: 32rpx;font-weight: bold;">
													￥{{ itt.unitPrice}}</view>
												<view style="font-size: 30rpx;color: #9393AA;margin-left: 40rpx;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;width: 400rpx;color: #000000;">{{itt.name}}</view>
												<!-- <view class="tao">套餐</view> -->
											</view>

											<view class="money">
												<view class="sale" style="padding-left: 12rpx;">
													<view class="prices">门市价：</view>
													<view class="prices">￥{{ itt.showPrice }}</view>
												</view>
												<view class="over" style="text-align: right;">已售{{ itt.totalSale }}
												</view>
											</view>
										</view>
									</view>
								</view>
							</view>
						</view>
						<view style="width: 100%;height:10rpx ; background-color: #F8F8F8;margin-top: 20rpx;"></view>
					</view>
					<view style="margin-top: 50rpx;" v-if="!showList">
						<u-divider color="#DEDEDE" half-width="120" border-color="#DEDEDE">{{ prompts }}</u-divider>
					</view>

				</view>
				<view v-if="current == 2">
					<view class="unit" v-for="(ites, indes) in tuanList" :key="indes" @click="tuanDetail(ites)">
				
						<view style="width: 100%;margin: auto;display: flex;"  >
							<view style="width:23% ;">
								<image class="" style="width: 146rpx;height: 132rpx;" :src="ites.coverImage"
									mode="aspectFill"></image>
							</view>
							<view style="width:77%;">
								<view style="color: #3F3F3F;font-size: 30rpx;font-weight: 800;display: flex;justify-content: space-between;">
									<text>
										{{ ites.name }}
									</text>
									<text style="color: #EE0C00;">
										￥{{ites.unitPrice?ites.unitPrice:0}}
									</text>
								</view>
								<view style="display: flex;align-items: center;margin: 10rpx 0rpx;display: flex;justify-content: space-between;">
									<view style="color: #B2B2B2;">
										<text>销量{{ites.totalSale?ites.totalSale:0}}</text>
										<text style="margin: 0 4rpx;">丨</text>
										<text>评分{{ites.score?ites.score:0}}</text>
									</view>
									<view style="color: #B2B2B2;" v-if="ites.distance">距离{{ites.distance}}㎞</view>
								</view>
								<view style="overflow: hidden; width: 100%;display: flex;" @click.stop="shopDetail(ites)">
									<view style="line-height: 42rpx;color: #7D7D7D;">{{ites.entName}}</view>
									<view style="display: flex; justify-content: center; align-items: center;margin-left: 2rpx;">
										<image style="width: 12rpx;height: 24rpx;display: flex; justify-content: center; align-items: center;" src="https://beedao.oss-cn-beijing.aliyuncs.com/f5547d392b54426baf8f7f22b366aafe.png" alt=""></image>
									</view>
								</view>
							</view>
							
						</view>
						<view style="width: 100%;height:10rpx ; background-color: #F8F8F8;margin-top: 20rpx;"></view>
					</view>
					<view style="margin: 40rpx;" v-if="!showList">
						<u-divider color="#DEDEDE" half-width="120" border-color="#DEDEDE">{{ prompts }}</u-divider>
					</view>
				
				</view>
			</view>
		</mescroll-body>

		<u-toast ref="uToast" />
	</view>

</template>

<script>
	var that
	export default {
		components: {},
		data() {

			return {
				background: {
					backgroundColor: '#fca800',
				},
				show: false,
				texts: '',
				list: [{
					name: '服务'
				}, {
					name: '商家'
				}, {
					name: '套餐'
				}],
				token: '',
				current: 0,
				serviceList: [],
				servetuijian: [],
				tuanList:[],//团购列表
				customStyle: {
					color: '#FFFFFF',
					background: '#FABC90'
				},

				titleName: null, //标题名
				redirectId: null, //分类ID
				chargeTyape: null, //1按小时；2按面积；3按内容；4按月
				isShow: false,
				pageSize: 10,
				page: 1,
				siteName: null, //城市
				employeesList: [],
				prompt: '没有更多了',

				// 下拉刷新配置
				downOption: {
					use: false,
					auto: true,
					offset: 40
				},
				upOption: {
					use: true,
					auto: false
				},
				mescroll: null,
				shops: [],
				count: 5,
				showList: false,
				totalPage: 1,
				prompts: '没有更多了',
				comHeight: 0,
				lat:"",
				lng :"",
			};
		},
		onLoad(option) {
			that = this;
			that.getLocationInfo()
			var menuButtonInfo = uni.getMenuButtonBoundingClientRect();
			const {
				top,
				width,
				height,
				right
			} = menuButtonInfo;
			uni.getSystemInfo({
				success: res => {
					const {
						statusBarHeight
					} = res;
					const margin = top - statusBarHeight;
					var navHeight = height + statusBarHeight + margin * 4;
					that.comHeight = (res.windowHeight - navHeight - 200) + 'px';
				}
			});
			that.titleName = option.titleName; //标题名称
			that.token = uni.getStorageSync('token');
			that.texts = option.keyword
			that.search_fw(option.keyword);
			that.getRecommendedService()
			
			this.getLocaltion();
			
		},
		filters: {

		},
		onReachBottom() {
			if (this.current == 1) {
				this.page += 1;
				that.getSearchBusinessList(option.keyword)
			}

		},
		methods: {
			// 获取缓存位置
			getLocationInfo() {
				var _this = this;
				uni.getStorage({
					key: 'siteName',
					success: res => {
						_this.siteName = res.data;
						_this.getSearchBusinessList();
						console.log(_this.siteName)
					},
					fail: resd => {
						//2. 获取地理位置
						uni.getLocation({
							type: 'wgs84',
							success(res) {
								let latitude, longitude;
								latitude = res.latitude.toString();
								longitude = res.longitude.toString();
								var myAmapFun = new amap.AMapWX({
									key: _this.http.mapVxKey
								});
								myAmapFun.getRegeo({
									location: '' + longitude + ',' + latitude + '', //location的格式为'经度,纬度'
									success: function(e) {
										_this.siteName = e[0].regeocodeData.addressComponent.city; //城市
										uni.setStorage({
											key: 'siteName',
											data: e[0].regeocodeData.addressComponent.city
										});
									},
									fail: function(info) {}
								});
								_this.getSearchBusinessList();
							},
							fail(resd) {
								_this.getSearchBusinessList();
							}
						});
					}
				});
			},
			//去团购详情
			tuanDetail(item){
				if (!this.token) {
					this.islogin();
					return;
				}
				uni.navigateTo({
					url: '/pageageA/home/shopDetails/tuangouDetails/tuangouDetails?enterpriseId=' + item.enterpriseId+"&packageBusinessId=" +item.packageBusinessId
					// url:'./online_order2?enterpriseId='+item.enterpriseId+'&chargeType='+this.chargeType+'&businessId='+this.businessId+'&supId=0'+'&titleName='+this.titleName+'&name='+name
				})
			},
			//去商家详情
			shopDetail(item) {
				if (!this.token) {
					this.islogin();
					return;
				}
				uni.navigateTo({
					url: '/pageageA/home/shopDetails/shopDetails?enterpriseId=' + item.enterpriseId
					// url:'./online_order2?enterpriseId='+item.enterpriseId+'&chargeType='+this.chargeType+'&businessId='+this.businessId+'&supId=0'+'&titleName='+this.titleName+'&name='+name
				})
			},
			doSearch() {
				that.page = 1;

				if (that.current == 0) {
					that.shops = [];
					that.serviceList = '';
					that.search_fw(that.texts);
				} else if(that.current == 1){
					that.shops = [];
					that.serviceList = '';
					that.getSearchBusinessList(that.texts)
				}else{
					that.tuanList = [];
					that.serviceList = '';
					that.gettuanList(that.texts)
				}

			},
			//跳转选择城市
			jumpToSelectCity: function() {
				if (!this.token) {
					this.islogin();
					return;
				} else {
					uni.navigateTo({
						url: '/pageageA/home/selectCity/selectCity?cityName=' + this.siteName
					});
				}
			},
			islogin() {
				uni.showModal({
					title: '登录提示',
					content: '该功能需要登录后使用。',
					confirmText: '去登录',
					success: function(res) {
						if (res.confirm) {
							uni.navigateTo({
								url: '/pages/login/login'
							});
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
				return;
			},
			//推荐跳转
			gojump(item) {
				if (!this.token) {
					this.islogin();
					return;
				}
				switch (item.redirectType) {
					case 1:
						//非她莫属
						uni.navigateTo({
							url: '/pageageA/home/matching/matching?serviceType=' + item.redirectId +
								'&titleName=' + item.name
						});
						break;
					case 2:
						//保姆列表
						uni.navigateTo({
							url: '/pageageA/home/almightyNanny/almightyNanny?titleName=' + item.name +
								'&redirectId=' + item.redirectId
						});
						break;
					case 3:
						//跳转二级分类页
						uni.switchTab({
							url: 'pages/service/service'
						});
					case 4:
						uni.navigateTo({
							url: '/pageageA/service/matching/matching?businessId=' + item.redirectId +
								'&chargeType=' + item.chargeType + '&titleName=' + item.name
						});
						break;
					case 6:
						//公众号
						// uni.navigateTo({
						// 	url: '../../pageageA/service/matching/matching?businessId=' + item.redirectId + '&chargeType=' + item.chargeType
						// });
						// if (item.redirectUrl.includes('https://') || item.redirectUrl.includes('http://')) {
						// 	location.href = item.redirectUrl;
						// } else {
						// 	location.href = 'https://${item.redirectUrl}';
						// }
						uni.navigateTo({
							url: '/pageageA/home/fwb_home?activity=' + item.redirectUrl
						});

						break;
					case 8:
						uni.navigateTo({
							url: '/pageageA/placeOrder/selectService?businessId=' + item.businessId
						});
						break;
					case 9:
						uni.navigateTo({
							url: '/pageageA/placeOrder/selectService?businessId=' + item.redirectId
						});
						break;
					default:
						break;
				}

			},
			// 登录判断
			islogin() {
				uni.showModal({
					title: '登录提示',
					content: '该功能需要登录后使用。',
					confirmText: '去登录',
					success: function(res) {
						if (res.confirm) {
							uni.navigateTo({
								url: '/pages/login/login'
							});
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
				return;
			},
			serviceList_jump(item) {
				if (!this.token) {
					this.islogin();
					return;
				}
				switch (item.chargeType) {
					case 1:
						// uni.navigateTo({
						// 	url: '/pageageA/service/serviceDetail?titleName=' + item.name + '&redirectId=' + item.businessId + '&chargeType=' + item.chargeType
						// });
						uni.navigateTo({
							url: '/pageageA/placeOrder/selectService?businessId=' + item.businessId
						});
						break;
					case 2:
						uni.navigateTo({
							url: '/pageageA/placeOrder/selectService?businessId=' + item.businessId
						});
						break;
					case 3:
						uni.navigateTo({
							url: '/pageageA/placeOrder/selectService?businessId=' + item.businessId
						});
						break;
					case 4:
						uni.navigateTo({
							url: '/pageageA/home/almightyNanny/almightyNanny?titleName=' + item.name +
								'&redirectId=' + item.businessId
						});
						break;
					default:
						break;
				}

			},
			serach() {
				uni.navigateTo({
					url: '../../pageageA/home/search/search'
				});
			},
			// 搜索内容
			search_fw(keyword) {
				let opts = {
					way: true, //true JSON请求；false 表单请求
					method: 'post',
					url: 'search/getSearchServiceList'
				};
				let data = {
					searchContent: keyword
				};
				this.http.httpTokenRequest(opts, data).then(res => {
					//打印请求返回的数据

					if (res.code == '200') {
						this.serviceList = res.data.searchList;

					} else {
						this.$refs.uToast.show({
							title: res.message,
							type: 'error'
						});
					}
				});
			},
			// 获取经纬度
			getLocaltion(){
				var that=this;
				uni.getLocation({
					type: 'wgs84',
					success(res) {
						that.lat = res.latitude;
						that.lng = res.longitude;
						that.gettuanList(that.texts);
					},
					fail(resd){
						that.gettuanList(that.texts);
					}
				});
			},
			// 获取套餐列表
			gettuanList(keyword){
				let opts = {
					way: true, //true JSON请求；false 表单请求
					method: 'post',
					url: 'search/getSeacherPackageList'
				};
				let data = {
					searchContent: keyword,
					lat:this.lat,
					lng:this.lng,
					page: this.page,
					pageSize: this.pageSize
				
				};
				this.http.httpTokenRequest(opts, data).then(res => {
					//打印请求返回的数据
					if (res.code == '200') {
						if (this.page == 1) {
							this.tuanList = res.data.records;
						} else if (this.page > 1 && this.pages <= res.data.pages) {
							this.tuanList = this.shops.concat(res.data.records);
						}
				
					} else {
						this.$refs.uToast.show({
							title: res.message,
							type: 'error'
						});
					}
				});
			},
			// 商家名称搜索
			getSearchBusinessList() {
				let opts = {
					way: true, //true JSON请求；false 表单请求
					method: 'post',
					url: 'search/getSearchBusinessList'
				};

				if (this.siteName == "" || !this.siteName) {
					this.siteName = "郑州"
				}
				let data = {
					searchContent: this.texts,
					city: this.siteName,
					page: this.page,
					pageSize: this.pageSize

				};
				this.http.httpTokenRequest(opts, data).then(res => {
					//打印请求返回的数据
					if (res.code == '200') {
						if (this.page == 1) {
							this.shops = res.data.records;
						} else if (this.page > 1 && this.pages <= res.data.pages) {
							this.shops = this.shops.concat(res.data.records);
						}

					} else {
						this.$refs.uToast.show({
							title: res.message,
							type: 'error'
						});
					}
				});
			},
			// 为你推荐
			getRecommendedService() {
				let opts = {
					way: true, //true JSON请求；false 表单请求
					method: 'post',
					url: 'search/getRecommendedService'
				};
				let data = {

				};
				this.http.httpTokenRequest(opts, data).then(res => {
					//打印请求返回的数据

					if (res.code == '200') {
						this.servetuijian = res.data;


					} else {
						this.$refs.uToast.show({
							title: res.message,
							type: 'error'
						});
					}
				});
			},
			change(index) {
				this.current = index;
				this.page = 1;
			},
			FormData(data) {
				switch (data) {
					case 1:
						return '小学';
					case 2:
						return '初中';
					case 3:
						return '高中';
					case 4:
						return '大专';
					case 5:
						return '本科';
					case 6:
						return '研究生';
					default:
						return;
				}
			},
			mescrollInit(mescroll) {
				this.mescroll = mescroll;
			},
			// 下拉刷新回调函数
			downCallback() {
				setTimeout(() => {
					this.mescroll.endSuccess();
					this.page = 1;
					this.shops = [];
					this.prompts = '加载中....';
					this.getShops();
				}, 2000);
			},
			//获取家政人员
			getHousekeeper: function() {
				let opts = {
					way: true, //true JSON请求；false 表单请求
					method: 'post',
					url: 'employee/list'
				};
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				if (this.siteName == "") {
					this.siteName = "郑州"
				}
				let data = {
					pageIndex: this.page,
					pageSize: this.pageSize,
					city: this.siteName,
					businessId: this.redirectId
				};
				this.http.httpTokenRequest(opts, data).then(res => {
					//打印请求返回的数据  
					uni.hideLoading();
					if (res.code == "200") {
						if (res.data.records.length > 0 || this.page != 1) {
							this.isShow = false;
							if (res.data.current * res.data.size < res.data.total) {
								for (const key in res.data.records) {
									this.serviceList.push(res.data.records[key]);
								}
								this.prompt = '加载中....';
							} else {
								for (const key in res.data.records) {
									this.serviceList.push(res.data.records[key]);
								}
								this.prompt = '没有更多了';
							}
						} else {
							this.isShow = true;
						}
					} else {
						this.$refs.uToast.show({
							title: res.message,
							type: 'error'
						})
					}

				});
			},
			// 获取商家列表
			getShops() {
				var _this = this;
				let opts = {
					way: true, //true JSON请求；false 表单请求
					method: 'post',
					url: 'enterprise/byBusinessPage',
				};
				if (this.siteName == "") {
					this.siteName = "郑州"
				}
				let data = {
					businessId: _this.businessId,
					page: _this.page,
					city: _this.siteName,
					pageSize: _this.pageSize,
				};
				_this.http.httpTokenRequest(opts, data).then(res => {
					// uni.hideLoading();
					if (res.code == 200) {
						_this.totalPage = res.data.pages;
						if (res.data.records.length > 0 || _this.page != 1) {
							_this.showList = false;
							if (res.data.current * res.data.size < res.data.total) {
								for (const key in res.data.records) {
									_this.shops.push(res.data.records[key]);
								}
								_this.prompts = '加载中....';
							} else {
								for (const key in res.data.records) {
									_this.shops.push(res.data.records[key]);
								}
								_this.prompts = '没有更多了';
							}
						} else {
							_this.showList = true;
							_this.shops = [];
						}
					} else {
						_this.$refs.uToast.show({
							title: res.message,
							type: 'error'
						})
					}
				})
			},

		}
	};
</script>

<style>
	page {
		background-color: white;
	}

	.unit {
		padding-top: 20rpx;
		/* padding: 28rpx 0rpx 0rpx 0rpx; */
		width: 100%;
		margin: auto;
	}

	.unit1 {
		display: flex;
		padding-bottom: 24rpx;
		border-bottom: 1px solid #e8e8f6;
	}

	.unit1 .img {
		width: 122rpx;
		height: 122rpx;
		background: #e4e4e4;
		opacity: 1;
	}

	.unit1 .shop {
		margin-left: 18rpx;
	}

	.shop .all {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.shop .all .nam {
		font-size: 30rpx;
		color: #3f3f3f;
		font-weight: 500;
	}

	.shop .all .year {
		width: 160rpx;
		height: 36rpx;
		background: #fff2d9;
		border: 1px solid #f29423;
		opacity: 1;
		border-radius: 10rpx 0px 10rpx 0px;
		font-size: 22rpx;
		color: #f29423;
		text-align: center;
	}

	.bott {
		display: flex;
		justify-content: space-between;
		color: #9393aa;
		font-size: 26rpx;
		margin-top: 14rpx;
	}

	.service {
		display: flex;
		align-items: center;
	}

	.service image {
		width: 29rpx;
		height: 27rpx;
	}

	.service view {
		padding-left: 18rpx;
	}

	.unit2 {
		/* // padding: 10rpx 0rpx;
		// display: flex; */
	}

	.unit2 .white {
		width: 122rpx;
	}

	.sales {

		padding: 26rpx 0 20rpx 0rpx;
	}

	.hour {
		font-size: 26rpx;
		color: #9393aa;
		display: flex;
		align-items: center;
	}

	.hour .tao {
		color: #f29423;
		font-size: 20rpx;
		border: 1px solid #f29423;
		text-align: center;
		margin-left: 16rpx;
		padding: 0 8rpx;
		height: 28rpx;
		line-height: 26rpx;
	}

	.money {
		width: 100%;
		display: flex;
		justify-content: space-between;
		margin-top: 4rpx;
	}

	.money .sale {
		display: flex;
		font-size: 26rpx;
	}

	.sale .price {
		color: #f29423;
	}

	.sale .prices {
		text-decoration: line-through;
		font-size: 20rpx;
		color: #CECED1;
		margin-left: 12rpx;
	}

	.over {
		color: #989898;
		font-size: 26rpx;
	}

	.sa_bottoms {
		padding: 26rpx 0rpx 0rpx 0rpx;
		border-top: 2rpx solid #e8e8f6;
	}
</style>
